package model

import "github.com/gogf/gf/v2/os/gtime"

type SystemMonitorData struct {
	StartTime string                  `json:"startTime" dc:"服务启动时间"`
	LoadAvg   []*SystemMonitorLoadAvg `json:"loadAvg" dc:"服务负载平均值，定时任务统计"`
	Net       []*SystemMonitorNet     `json:"net" dc:"网络流量监控统计"`
}

type SystemMonitorLoadAvg struct {
	T        *gtime.Time `json:"t" dc:"时间"`
	TimeDesc string      `json:"loadTime" dc:"时间"`
	LoadAvg  float64     `json:"loadAvg" dc:"负载平均值"`
}

type SystemMonitorNet struct {
	T              *gtime.Time `json:"t" dc:"统计时间"`
	TimeDesc       string      `json:"timeDesc" dc:"时间"`
	BytesReceive   uint64      `json:"bytesReceive" dc:"下行流量"` // number of bytes received
	ReceiveAvg     uint64      `json:"receiveAvg"`             //平均下载量（下载字节数的变化量除以时间间隔）
	ReceiveAvgDesc string      `json:"receiveAvgDesc"`         //下载速率格式化，kb、mb、tb等
	BytesSend      uint64      `json:"bytesSend" dc:"上行流量"`    // number of bytes sent
	SendAvg        uint64      `json:"sendAvg"`                //平均上传量
	SendAvgDesc    string      `json:"sendAvgDesc"`
}

type SystemMonitorItem struct {
	Label string      `json:"label"`
	Value interface{} `json:"value"`
}
